<body>
  <script>
     window.gbar={};
     var b = window.gbar;
     b.qs=function() {
        alert('function!');
     };
  </script>
  <div id="gbar"></div>
  <a href="#" onclick="gbar.qs(); return false;">click</a>
</body>
